(display "\n========================================\n")
(define (up-split painter n)
    (if (= n 0)
        painter
        (let ((smaller (up-split painter (- n 1))))
            (below painter (beside smaller smaller)))))

(define (right-split painter n)
    (if (= n 0)
        painter
        (let ((smaller (right-split painter (- n 1))))
            (beside painter (below smaller smaller)))))

(define (split order1 order2)
    (lambda (painter n)
        (if (= n 0)
            painter
            (let ((smaller ((split order1 order2) painter (- n 1))))
                (order1 painter (order2 smaller smaller))))))

(define right-split (split beside below))
(define up-split (split below beside))
(display "\n========================================\n")